package com.msdemo.user.controller;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
* @comments
* @author zg
* @date 2017年9月28日
*/
@RestController
@RequestMapping("/user/")
public class UserController {

	private Logger logger = LogManager.getLogger(this.getClass());
	
	@RequestMapping("integral")
	public String integral(@RequestParam(name="userName", required = true) String userName,
						   @RequestParam(name="integral", required = true) Integer integral) {
		
		logger.info("用户服务 - 用户【{}】购买了商品，积分 +{}", userName, integral);
		
		return "success";
	}
}
